FROM rise0chen/unmp_build:latest as builder

# Set workspace
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

# Build runtime environment

# Build app
COPY . /usr/src/app
RUN cargo update
RUN cargo build --bin center --release


FROM debian:buster-slim
RUN apt-get update && apt-get install -y pkg-config libssl-dev
COPY --from=builder /usr/src/app/target/release/center /usr/local/bin/center

EXPOSE 16464
CMD [ "center"]
